home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Textfiles / cracking / AhtonsCrackingTutorial.sit.hqx / Ahton's Kracking Text Tools.rsrc / TEXT_139.txt < prev    next >
Text File  |  1997-07-27  |  7KB  |  73 lines

  1.  
  2.  
  3. What is Patching & How to a Make Patch‚Ķ
  4.  
  5.  
  6.  
  7. ResCompare can be used to create a self‚Äìapplying patch application. You can use the patch to distribute upgrades of your software without sending a new copy of the entire application. Patches are typically 40% of the original Ô¨Åle, so you can save disk space and communications upload/download time by sending the patch instead of the entire application. Also, the patch is only useful to owners of the original version, so you can distribute patches to your commercial software over public bulletin boards.
  8.  
  9. How to Apply a Patch
  10.  
  11. Patches are easy to apply. Just open a self‚Äìapplying patch and it displays some notes, then prompts you for the Ô¨Åle to patch. A bar graph displays the progress. When done, it tells you if it was suc-cessful. It‚Äôs that simple‚Äîa real no‚Äìbrainer.
  12.  
  13.  
  14. Creating Self‚ÄìApplying Patches
  15.  
  16. Self‚Äìapplying patches are created with ResCompare‚Äôs Make Patch‚Ķ command. Select the resources that you want included in the patch and choose Make Patch. ResCompare asks if you want to create a new patch or append to an existing patch. If you‚Äôre making a new patch, click New. A second dialog lets you set various patch options.
  17.  
  18. ‚Ä¢    You can choose the prompt that the patch will use when asking for the original Ô¨Åle. By default, the prompt will be ‚ÄúWhere is ‚Äòoriginal Ô¨Åle?‚Äù, where original Ô¨Åle is the name of your master Ô¨Åle.
  19.  
  20. ‚Ä¢    You can also choose whether you want the original Ô¨Åle to be patched in place, or whether you want the patch application to make a copy Ô¨Årst. If you would prefer the patch to make a copy, you can choose a default name for the copy. After opening the original Ô¨Åle, the patch will prompt the user to save a copy. If the user replaces the original Ô¨Åle, the patch application does not make a copy, but patches the original Ô¨Åle in place anyway.
  21.  
  22. When you click OK, ResCompare asks you to save the patch. It then Ô¨Ånds the differences between the selected resources and saves them in the self‚Äìapplying patch.
  23.  
  24. One Patch for Many Versions
  25.  
  26. If you have released several versions of your application, you can create a patch that will work with all released versions. I‚Äôll go through an example that describes the process. Let‚Äôs say you have three released versions of your application named Sample: version 1.0, version 1.0.1 and version 1.2. You want to release version 1.3 as a self‚Äìapplying patch that will upgrade all existing versions.
  27.  
  28. ‚Ä¢    Create the patch ‚ÄúSample 1.3 patch,‚Äù as described above, that patches version 1.0 to 1.0.1.
  29.  
  30. ‚Ä¢    Using ResCompare, compare version 1.0.1 to version 1.2. Select the changed resources and choose Make Patch‚Ķ When asked if you want to create a new patch, click the Append button and select ‚ÄúSample 1.3 patch,‚Äù which you created in step 1. After opening the patch, you will have an opportunity to adjust the patch options.
  31.  
  32. ‚Ä¢    Repeat step 2 for the changes from version 1.2 to 1.3. You now have a self‚Äìapplying patch that can upgrade versions 1.0, 1.0.1 and 1.2 of Sample to version 1.3.
  33.  
  34. An easy way to do this incrementally is:
  35.  
  36. ‚Ä¢    Create the Ô¨Årst patch for the Ô¨Årst upgrade.
  37.  
  38. ‚Ä¢    When the time comes to release the second upgrade, duplicate the patch for the Ô¨Årst upgrade, rename it, and append the new patch information to it.
  39.  
  40. ‚Ä¢    For each subsequent upgrade, always duplicate and rename the last patch you created, and append your changes to it.
  41.  
  42. One Patch for Many Files
  43.  
  44. A single patch can also contain the information needed to patch multiple Ô¨Åles. Simply compare each additional Ô¨Åle and append the patch information, as describe above. The patch options can be set individually for each Ô¨Åle you want patched.
  45.  
  46. Adding Notes to the Patch
  47.  
  48. Open the patch with a resource editor and edit TEXT/styl resource 128. This resource contains the patch notes that are displayed when the patch is Ô¨Årst opened. You can add your own notes here if you like. Remember, leave the paragraph that begins ‚ÄúThis patch application was created‚Ķ‚Äù at the end of the notes. Do not alter this paragraph.
  49.  
  50. Localizing a Patch
  51.  
  52. You can localize an individual patch by changing its dialog, alert, and string resources. If you would like to create a version of ResCompare that will always generate your localized self‚Äìapplying patch, follow these steps:
  53.  
  54. ‚Ä¢    Make a small patch and localize all text, except for the resources 'ZVER', 'ZAP#', 'ZIL#', 'ZIS#', and 'ZAP '. You may localize the default patch notes, including the ResCompare notice at the end. Just don‚Äôt remove the notice.
  55.  
  56. ‚Ä¢    Open the patch in ResCompare and select all resources except those listed above.
  57.  
  58. ‚Ä¢    Choose the Encapsulate‚Ķ command from the File menu. This command creates a new resource Ô¨Åle and saves the selected resources into it, stripped of their resource types, IDs, and attributes. All selected resources are written to the encapsulated Ô¨Åle with the type 'RES '. Also, a resource of type 'RES#' is written to the Ô¨Åle, which contains a mapping of each encapsulated resource to its original resource. ResCompare contains a ResEdit template for the 'RES#' resource type, so you can view its contents. See Appendix 1 for a source code listing that will expand an encapsulated resource Ô¨Åle back into its original form.
  59.  
  60. ‚Ä¢    Make a copy of ResCompare and open it and the encapsulated patch in ResEdit.
  61.  
  62. ‚Ä¢    Select all 'RES ' and 'RES#' resources from the ResCompare copy and delete them. Select all 'RES ' and 'RES#' resources from the encapsulated patch and copy them to ResCompare. Close and save the ResCompare copy.
  63.  
  64. ResCompare will now use your localized version each time you create a new patch.
  65. Limitations
  66. Always patch a copy of your application, not the original. Never patch your master disks. Use the ‚Äúpatch a copy‚Äù option if your users might not follow this advice.
  67.  
  68. ResCompare allows you to append patches whose version numbers are not in strict ascending order, but it warns you when it detects this situation. Be sure to test such patches thoroughly, on all intended versions of your application, since this disables version checking.
  69.  
  70. Self‚Äìapplying patches work on applications the same way that some viruses do (by mod-ify-ing their CODE resources). Because of this, some virus detectors may get upset when a patch starts doing its thing. Your best bet is to turn off virus protectors and restart before patching. Because of this limitation, please remember to check your Ô¨Çoppies for viruses before distributing a patch on them.
  71.  
  72. The self‚Äìapplying patch requires some free space on the volume, and it makes every possible attempt to apply the patch within the space provided. However, I have had some reports of problems patching Ô¨Åles on a nearly full Ô¨Çoppy. I therefore suggest copying the Ô¨Åle to your hard disk before patching.
  73.